// 使用 stat-mode 获取文件权限

let fs = require('fs'),
Mode = require('stat-mode');



fs.stat('./note.md', (err, stats) => {
  if(err) console.log('stat:err:', err)
  console.log('-----------文件对象？----------------stats:', stats)
  // get permissions
  let mode = new Mode(stats)

  console.log('-----------Mode----------------mode:', mode)
  console.log(mode.toString())
  console.log('Group execute:' + mode.group.execute)
  console.log('Others write:' + mode.others.write)
  console.log('Owner read:' + mode.owner.read)
})

